package com.sm.dao;

import java.util.List;

import com.github.pagehelper.Page;
import com.sm.model.Order;
import org.apache.ibatis.annotations.Param;

public interface OrderMapper {
    int deleteByPrimaryKey(Integer orderId);

    int insert(Order record);

    int insertSelective(Order record);

    Order selectByPrimaryKey(Integer orderId);

    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order record);

    Page<Order> selectOrderByOrderStatus(@Param("userId")Integer userId, @Param("orderStatus")Integer orderStatus);

    /**
     * 根据订单编号查询订单列表
     * @param orderNum
     * @return
     */
    List<Order> selectByOrderNum(@Param("orderNum") String orderNum);

    List<Order> selectByStatus(@Param("status") Integer status);

    /**
     * 定时取消订单
     */
    void cancelOrder();

    int countByStatus(@Param("type") Integer type, @Param("userId") Integer userId);

    Order selectByOrderOn(@Param("orderOn") String orderOn);
}
